﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductList.ascx.cs" Inherits="Controls_BackEnd_ProductList" %>
<%@ Import Namespace="Business" %>
<div id="content-outer">
    <!-- start content -->
    <div id="content">
        <!--  start page-heading -->
        <div id="page-heading">
            <h1>
                <%=Resources.Resource.ProductList%></h1>
        </div>
        <!-- end page-heading -->
        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
            <tr>
                <th rowspan="3" class="sized">
                    <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowleft.jpg"
                        width="20" height="300" alt="" />
                </th>
                <th class="topleft">
                </th>
                <td id="tbl-border-top">
                    &nbsp;
                </td>
                <th class="topright">
                </th>
                <th rowspan="3" class="sized">
                    <img src="<%=Config.ApplicationUrl %>resources/images/admin/shared/side_shadowright.jpg"
                        width="20" height="300" alt="" />
                </th>
            </tr>
            <tr>
                <td id="tbl-border-left">
                </td>
                <td>
                    <!--  start content-table-inner ...................................................................... START -->
                    <div id="content-table-inner">
                        <!--  start table-content  -->
                        <div id="table-content">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <!--  start message-yellow -->
                                    <div id="message-yellow" style="display: none;">
                                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td class="yellow-left">
                                                    You have a new message. <a href="">Go to Inbox.</a>
                                                </td>
                                                <td class="yellow-right">
                                                    <a class="close-yellow">
                                                        <img src="<%=Config.ApplicationUrl %>resources/images/admin/table/icon_close_yellow.gif"
                                                            alt="" /></a>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <!--  end message-yellow -->
                                    <!--  start message-red -->
                                    <div id="message-red" style="display: none;">
                                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td class="red-left">
                                                    Error. <a href="">Please try again.</a>
                                                </td>
                                                <td class="red-right">
                                                    <a class="close-red">
                                                        <img src="<%=Config.ApplicationUrl %>resources/images/admin/table/icon_close_red.gif"
                                                            alt="" /></a>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <!--  end message-red -->
                                    <!--  start message-blue -->
                                    <div id="message-blue" style="display: none;">
                                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td class="blue-left">
                                                    Welcome back. <a href="">View my account.</a>
                                                </td>
                                                <td class="blue-right">
                                                    <a class="close-blue">
                                                        <img src="<%=Config.ApplicationUrl %>resources/images/admin/table/icon_close_blue.gif"
                                                            alt="" /></a>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <!--  end message-blue -->
                                    <!--  start message-green -->
                                    <div id="message-green" style="display: none;">
                                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td class="green-left">
                                                    Product added sucessfully. <a href="">Add new one.</a>
                                                </td>
                                                <td class="green-right">
                                                    <a class="close-green">
                                                        <img src="<%=Config.ApplicationUrl %>resources/images/admin/table/icon_close_green.gif"
                                                            alt="" /></a>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <!--  end message-green -->
                                    <!--  start product-table ..................................................................................... -->
                                    <fieldset>
                                        <legend><strong>
                                            <%=Resources.Resource.FindInfo %></strong></legend>
                                        <label style="float: left; width: 100px">
                                            <%=Resources.Resource.FindType %>
                                            :
                                        </label>
                                        <label style="float: left; width: 200px">
                                            <asp:DropDownList CssClass="styledselect_form_1" ID="ddlType" runat="server">
                                                <asp:ListItem Value="0">Chọn loại tìm kiếm</asp:ListItem>
                                                <asp:ListItem Value="id">Tìm theo ID</asp:ListItem>
                                                <asp:ListItem Value="name">Tìm theo tên</asp:ListItem>
                                            </asp:DropDownList>
                                        </label>
                                        <div class="clear">
                                        </div>
                                         <label style="float: left; width: 100px">
                                            <%=Resources.Resource.FindContent %>
                                        </label>
                                        <label style="float: left; width: 200px">
                                            <asp:TextBox ID="txtContent" CssClass="inp-form" runat="server"></asp:TextBox>
                                        </label>
                                        <label style="float: left; width: 100px">
                                            
                                        </label>
                                         <div class="clear">
                                        </div>
                                         <label style="float: left; width: 100px">
                                            <%=Resources.Resource.Category %>
                                        </label>
                                        <label style="float: left; width: 200px">
                                           <asp:DropDownList CssClass="styledselect_form_1" ID="ddlCategory" runat="server">                                              
                                            </asp:DropDownList>
                                        </label>
                                        <label style="float: left; width: 100px">
                                           <asp:Button OnClick="AllCommand" CssClass="form-submit" ID="btnSearch" runat="server"
                                                Text="Search" />
                                        </label>
                                    </fieldset>
                                    <fieldset>
                                        <legend><strong>
                                            <%=Resources.Resource.FindResult %></strong></legend>
                                        <br>
                                        <asp:GridView ID="grvData" class="listing" CellPadding="0" border="0" Width="100%"
                                            DataKeyNames="ProductID" runat="server" AutoGenerateColumns="False" OnRowCommand="grvData_RowCommand"
                                            OnRowDataBound="grvData_RowDataBound" OnRowEditing="grvData_RowEditing">
                                            <Columns>
                                                <asp:TemplateField HeaderStyle-CssClass="table-header-repeat line-left minwidth-1">
                                                    <HeaderTemplate>
                                                        <a href="javascript:void(0);">ID</a>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%#Eval("ProductID")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle CssClass="table-header-repeat line-left minwidth-1" />
                                                    <ItemStyle Width="3%" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderStyle-CssClass="table-header-repeat line-left minwidth-1">
                                                    <HeaderTemplate>
                                                        <a href="javascript:void(0);">Code</a>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%#Eval("ProductCode")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle CssClass="table-header-repeat line-left minwidth-1" />
                                                </asp:TemplateField>
                                                  <asp:TemplateField HeaderStyle-CssClass="table-header-repeat line-left minwidth-1">
                                                    <HeaderTemplate>
                                                        <a href="javascript:void(0);">Name</a>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%#Eval("ProductName")%>
                                                    </ItemTemplate>
                                                    <HeaderStyle CssClass="table-header-repeat line-left minwidth-1" />
                                                </asp:TemplateField>                                              
                                                <asp:TemplateField HeaderStyle-CssClass="table-header-repeat line-left minwidth-1">
                                                    <HeaderTemplate>
                                                        <a href="javascript:void(0);">Edit</a>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="IbtnAdd" CommandArgument='<%#Eval("ProductID") %>' CommandName="Edit"
                                                            Width="16" Height="16" ImageUrl="~/resources/images/admin/table/action_edit.gif"
                                                            runat="server" />
                                                    </ItemTemplate>
                                                    <HeaderStyle CssClass="table-header-repeat line-left minwidth-1" />
                                                    <ItemStyle Width="3%" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderStyle-CssClass="table-header-repeat line-left minwidth-1">
                                                    <HeaderTemplate>
                                                        <a href="javascript:void(0);">Delete</a>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="cbCheck" runat="server" />
                                                    </ItemTemplate>
                                                    <HeaderStyle CssClass="table-header-repeat line-left minwidth-1" />
                                                    <ItemStyle Width="3%" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </fieldset>
                                    <asp:Button ID="btndel" runat="server" Text="" OnClick="AllCommand" Style="display: none;" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                        <!--  end content-table  -->
                        <!--  start actions-box ............................................... -->
                        <div id="actions-box">
                            <a href="javascript:void(0);" class="action-slider"></a>
                            <div id="actions-box-slider">
                                <asp:LinkButton ID="lbtnAdd" OnClientClick=" Loading(100, 100, '');" class="action-add" runat="server" OnClick="AllCommand">Add</asp:LinkButton>
                                <asp:LinkButton ID="lbtnDel" OnClientClick="deletedata();return false;" class="action-delete"
                                    runat="server" OnClick="AllCommand">Delete</asp:LinkButton>                               
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                        <!-- end actions-box........... -->
                        <!--  start paging..................................................... -->
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="lbtnFirstPage" OnClick="AllCommand" class="page-far-left" runat="server"></asp:LinkButton>
                                            <asp:LinkButton ID="lbtnPreviewPage" OnClick="AllCommand" class="page-left" runat="server"></asp:LinkButton>
                                            <div id="page-info">
                                                Page <strong>
                                                    <asp:Literal ID="ltrCurent" runat="server"></asp:Literal></strong> /
                                                <asp:Literal ID="ltrTotal" runat="server"></asp:Literal></div>
                                            <asp:LinkButton ID="lbtnNextPage" OnClick="AllCommand" class="page-right" runat="server"></asp:LinkButton>
                                            <asp:LinkButton ID="lbtnLastPage" OnClick="AllCommand" class="page-far-right" runat="server"></asp:LinkButton>
                                        </td>
                                        <td>
                                            <asp:DropDownList onchange="ChangePage(this);" CssClass="Select_Page" Height="24"
                                                Width="130" ID="ddlPage" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                                <asp:Button ID="input" Style="display: none" runat="server" Text="not" OnClick="AllCommand" />
                                <asp:HiddenField ID="hdfPage" runat="server" />
                                <asp:HiddenField ID="hdfCount" runat="server" />

                                <script language="javascript" type="text/javascript">deletedata=function(mes,tit){if(!IsConfirm) {Confirm('<%=Resources.Resource.ConfirmDelete %>','<%=Resources.Resource.Warning %>',$control('<%=btndel.ClientID%>')); return false;}}; unloadPage = function() { };ChangePage = function(obj) {$control('<%=hdfPage.ClientID %>').value = obj.value; $control('<%=input.ClientID %>').click(); }</script>

                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <!--  end paging................ -->
                        <div class="clear">
                        </div>
                    </div>
                    <!--  end content-table-inner ............................................END  -->
                </td>
                <td id="tbl-border-right">
                </td>
            </tr>
            <tr>
                <th class="sized bottomleft">
                </th>
                <td id="tbl-border-bottom">
                    &nbsp;
                </td>
                <th class="sized bottomright">
                </th>
            </tr>
        </table>
        <div class="clear">
            &nbsp;</div>
    </div>
    <!--  end content -->
    <div class="clear">
        &nbsp;</div>
</div>

<script type="text/javascript">
reloadpage =function() {
	$('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
	$('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
}
</script>